import 'package:flutter/material.dart';
import 'package:hook_up_rent/pages/home/tab_search/dataList.dart';
import 'package:hook_up_rent/pages/home/tab_search/filter_bar/filter_drawer.dart';
import 'package:hook_up_rent/pages/home/tab_search/filter_bar/index.dart';
import 'package:hook_up_rent/widgets/search_bar/index.dart';
import 'package:hook_up_rent/widgets/room_list_item_widget.dart';

class TabSearch extends StatefulWidget {
  const TabSearch({super.key});

  @override
  State<TabSearch> createState() => _TabSearchState();
}

class _TabSearchState extends State<TabSearch> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        endDrawer: const FilterDrawer(),
        appBar: AppBar(
          elevation: 0,
          actions: [Container()],
          title: SearchBar(
            showLocation: true,
            showMap: true,
            onSearch: () {
              Navigator.of(context).pushNamed('search');
            },
          ),
          backgroundColor: Colors.blue,
        ),
        body: Column(
          children: [
            SizedBox(
              height: 41,
              child: FilterBar(
                onChange: (data) {},
              ),
            ),
            Expanded(
              child: ListView(
                children: dataList.map((e) => RoomListItemWidget(e)).toList(),
              ),
            )
          ],
        ));
  }
}
